<link type="text/css" rel="stylesheet" href="{url:#css/ucenter.css}" />
{echo:JS::import('form');}
{echo:JS::import('date');}
{echo:JS::import('dialog?skin=tinysimple');}
<script type="text/javascript" charset="UTF-8" src="{url:#js/jquery.iframe-post-form.js}"></script>

<div class="container clearfix">
	{widget:name=sub_navs action=ucsidebar sidebar=$sidebar act=$actionId}
	<div class="uc-content">
		<div class="box p10">
			<h1 class="title"><span>销售订单：</span></h1>
			<div class="mt10">
			<table class="simple">
				<tr>
					<th width='200'>订单编号</th>
					<th width="100">收货人</th> 
					<th width="100">订单金额</th> 
					<th width="150">下单时间</th> 
					<th width="150">订单状态</th>
					<th>操作</th>
				</tr>
				{query:name=order where=seller_id eq $user[id] order=id desc page=1 id=$obj}
				<tr {if:$key%2==1}class="even"{/if} align="center">
					<td>
						<a href="{url:/ucenter/dp_order_detail/id/$item[id]}"><i class="icon-order-{$item['type']}  ie6png"></i>{$item['order_no']}</a>
					</td>
					<td>{$item['accept_name']}</td> 
					<td>{$currency_symbol}{$item['order_amount']}</td> 
					<td>{$item['create_time']}</td> 
					<td>
						{set:$order_status=Common::getOrderStateByONo($item['order_no'])}
						{if:$order_status == 1}
							待付款
						{elseif:$order_status == 2}
							待发货
						{elseif:$order_status == 3}
							已发货，待收货
						{elseif:$order_status == 4}
							已签收
						{elseif:$order_status == 5}
							退款中
						{elseif:$order_status == 0}
							已关闭
						{/if}
					</td>
					<td>
					
					{if:$order_status == 2}
						<!-- 
						<a href="javascript:;" id="send_btn" class="btn btn-mini">发货</a>
						 -->
						<a href="javascript:;" id="send_btn" onclick="order_send({$item['id']})" class="btn btn-mini" style="color:red;">发货</a>
					{else:}
						无
					{/if}
					</td>
				</tr>
				{/query}
			</table>
			<div class="page-nav f12">{echo:$obj->pagebar()}</div>
			</div>
		</div>
	</div>
</div>



<div id="recharge-dialog" class="hidden">
<form target="_self" action="{url:/ucenter/order_send}" method="post" target="_blank" callback="close_dialog">
	<h1 align="center" style="font-size:18px;">添加物流信息</h1><br>
	<table class="form" style="width:500px;">
		<tr>
			<td class="label">物流公司：</td>
			<!-- 
			<td><input type="text" name="express"  pattern="required"></td>
			 -->
			<td>
				<select name="express_company_id" pattern="[1-9]*" alt="请选择物流公司">
					<option value="0">请选择</option>
				{query:name=express_company order=id asc page=1 id=$obj}
					<option value="{$item['id']}">{$item['name']}</option>
				{/query}
				</select>
			</td>
		</tr>
		<tr>
			<td class="label">物流单号：</td>
			<td>
				<input type="text" name="express_no"  pattern="required">
			</td>
		</tr>
		<tr>
			<td colspan="2" class="tc"><input type="submit" class="btn" value="发货"></td>
		</tr>
	</table>
	<input type="hidden" name="order_id" id="order_id"/>
	</form>
</div>
<script type="text/javascript">
function order_send(order_id)
{
	$("#order_id").val(order_id);
	art.dialog({id:'recharge-dialog',title:'添加物流信息',content:document.getElementById('recharge-dialog'),lock:true});
}
/*
$("#send_btn").on("click",function() {
	art.dialog({id:'recharge-dialog',title:'添加物流信息',content:document.getElementById('recharge-dialog'),lock:true});
});
*/
function close_dialog(e){
	if(!e)art.dialog({id:'recharge-dialog'}).close();
}



	function order_sign(id) {
		$.post("{url:/ucenter/order_sign}",{id:id},function(data){
			if(data['status']=='success'){
				location.reload();
			}
		},'json');
	}
</script>
